<?php
/**
 * Created by openXtiger.org.
 * User: Administrator
 * Date: 2009-5-11
 * Time: 16:08:21
 */
define('MS_XTIGER', dirname(__FILE__) .  '/../../xnetframework/');
define('MS_ROOT', dirname(__FILE__) . '/../');
include MS_XTIGER.'Common.php';
$seccode_cls = xt_load('library','seccode');
@header("Expires: -1");
@header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE);
@header("Pragma: no-cache");
$authkey = md5('XTrand2009625'.$_SERVER['HTTP_USER_AGENT'].xt_getip());
$seccode = xt_seccodeconvert(xt_authcode(xt_gget('seccode'), 'DECODE', $authkey));
$code = new $seccode_cls();
$code->code = $seccode;
$code->type = 1;
$code->width = 70;
$code->height = 21;
$code->background = 0;
$code->adulterate = 1;
$code->ttf = 1;
$code->angle = 0;
$code->color = 1;
$code->size = 0;
$code->shadow = 1;
$code->animator = 0;
$code->fontpath = MS_ROOT.'images/fonts/';
$code->datapath = MS_ROOT.'images/';
$code->includepath = './';
$code->display();

/*1.
$rand = rand(100000, 999999); 
$seccodeinit = rawurlencode(xt_authcode($rand, 'ENCODE', 'XTrand2009625', 180));

2.
$seccodehidden = urldecode(xt_pget('seccodehidden'));
$seccode = strtoupper(xt_pget('seccode'));
$seccodehidden = xt_authcode($seccodehidden, 'DECODE', 'XTrand2009625');
$seccodehidden = xt_seccodeconvert($seccodehidden);
if(empty($seccodehidden) || $seccodehidden != $seccode){}*/
?>